function processUrl() {
	
	function thread(data, success, request) {
		threadDisplay(data);
		userDisplay(data);
		siteInfoDisplay(data);
	}

	function board(data, success, request) {
		newAnswersDisplay(data);
		userDisplay(data);
		siteInfoDisplay(data);
	}

	var loginId = localStorage.getItem(loginIdKey);
	var encryptedPassword = localStorage.getItem(encryptedPasswordKey);
	var autoLogin = (loginId != null) && (encryptedPassword != null);
	var url = window.location.href;
	
	var boardIdExpression = new RegExp(".*#([0-9]+)$");
	var idExpression = new RegExp(".*#([0-9]+)-([0-9]+)$");
	
	/* Going to a post could be 1-1-1, or 1-1-50, or 1-1-end */
	var postExpression = new RegExp(".*#([0-9]+)-([0-9]+)-(.*)$");
	var xml = "";

	if (boardIdExpression.test(url)) {

		var results = boardIdExpression.exec(url);
		var boardId = results[1];

		xml = "<Requests>";

		if (autoLogin) {
			xml += loginMessage(loginId, encryptedPassword, true, false);
			xml += userInfoMessage();
		}

		xml += newAnswersMessage(boardId);
		xml += siteInfoMessage();
		xml += "</Requests>";

		sendMessage(xml, board);

	} else if (idExpression.test(url)) {

		/* Go to the start of a thread */
		
		var results = idExpression.exec(url);
		
		var boardId = results[1];
		var threadId = results[2];

		xml = "<Requests>";

		if (autoLogin) {
			xml += loginMessage(loginId, encryptedPassword, true, false);
			xml += userInfoMessage();
			xml += siteInfoMessage();
		}

		xml += threadMessage(boardId, threadId, showImages, start, pageSize);
		xml += "</Requests>";

		sendMessage(xml, thread);

	} else if (postExpression.test(url)) {
		
		/* We want to direct to a particular post and the subsequent x posts */
		
		var results = postExpression.exec(url);
		
		var boardId = results[1];
		var threadId = results[2];
		var postId = results[3];

		/* The API takes a -1 to get the most recent posts */
		if (postId == "end") {
			postId = "-1";
		} else if (postId == "read") {
			postId = "-2";
		}
		
		xml = "<Requests>";

		if (autoLogin) {
			xml += loginMessage(loginId, encryptedPassword, true, false);
			xml += userInfoMessage();
			xml += siteInfoMessage();
		}

		xml += threadMessage(boardId, threadId, showImages, postId, pageSize);
		xml += "</Requests>";
		
		sendMessage(xml, thread);
		
	} else {

		/* No hash tags means we're on the front page */

		if (autoLogin) {
			frontPageRequest(loginId, encryptedPassword);
		} else {
			frontPageRequest(null, null);
		}
	}
}